<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Win32k: ex.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Win32k
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00680_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ex.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00680.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a03629.html">precomp.h</a>&quot;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#pragma hdrstop</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;NTSTATUS</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<a class="code" href="a00680.html#acf9e2c7fe5f9c95e7c76d945174fb5ea">W32pProcessCallout</a>(</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    IN PW32PROCESS Process,</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    IN BOOLEAN Initialize</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    );</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keywordtype">void</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<a class="code" href="a00680.html#a39bfe79224ebaeb29c95e90995169aa8">ValidateThreadLocks</a>(</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <a class="code" href="a01881.html">PTL</a> NewLock,</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <a class="code" href="a01881.html">PTL</a> OldLock);</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;NTSTATUS</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="a00899.html#a80a4bdd9ccbc04bf79c9c3e18860adfd">   28</a></span>&#160;<a class="code" href="a00680.html#a80a4bdd9ccbc04bf79c9c3e18860adfd">OpenEffectiveToken</a>(</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    PHANDLE phToken)</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;{</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">     * Open the client&#39;s token.</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    Status = ZwOpenThreadToken(</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;                 NtCurrentThread(),</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;                 TOKEN_QUERY,</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;                 (BOOLEAN)TRUE,     <span class="comment">// OpenAsSelf</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;                 phToken</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;                 );</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keywordflow">if</span> (Status == STATUS_NO_TOKEN) {</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">         * Client wasn&#39;t impersonating anyone.  Open its process token.</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        Status = ZwOpenProcessToken(</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;                     NtCurrentProcess(),</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;                     TOKEN_QUERY,</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                     phToken</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;                     );</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    }</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;Can&#39;t open client&#39;s token! - Status = %lx&quot;</span>, Status);</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;}</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;NTSTATUS</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="a00899.html#a78f42004a414644ecfdc19b382cae57b">   61</a></span>&#160;<a class="code" href="a00680.html#a297222c1c05315b3b86e418aebd79748">GetProcessLuid</a>(</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread,</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    PLUID LuidProcess</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    )</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;{</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    PACCESS_TOKEN UserToken = NULL;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    BOOLEAN fCopyOnOpen;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    BOOLEAN fEffectiveOnly;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordflow">if</span> (Thread == NULL)</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        Thread = PsGetCurrentThread();</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="comment">// Check for a thread token first</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    UserToken = PsReferenceImpersonationToken(Thread,</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            &amp;fCopyOnOpen, &amp;fEffectiveOnly, &amp;ImpersonationLevel);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keywordflow">if</span> (UserToken == NULL) {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="comment">//</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <span class="comment">// No thread token, go to the process</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        <span class="comment">//</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160; </div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        UserToken = PsReferencePrimaryToken(Thread-&gt;ThreadsProcess);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="keywordflow">if</span> (UserToken == NULL)</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            <span class="keywordflow">return</span> STATUS_NO_TOKEN;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    }</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    Status = SeQueryAuthenticationIdToken(UserToken, LuidProcess);</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="comment">// We&#39;re finished with the token</span></div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    ObDereferenceObject(UserToken);</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;}</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;NTSTATUS</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="a00899.html#a2dc9a37319c0687eaf57b62a7f1ada4e">  107</a></span>&#160;<a class="code" href="a00680.html#a2dc9a37319c0687eaf57b62a7f1ada4e">CreateSystemThread</a>(</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    PKSTART_ROUTINE lpThreadAddress,</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    PVOID pvContext,</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    PHANDLE phThread)</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;{</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    OBJECT_ATTRIBUTES Obja;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <a class="code" href="a00953.html#a28301f76c53b643912da7c538f74e2c6">ASSERT</a>(ExIsResourceAcquiredExclusiveLite(<a class="code" href="a03257.html#ac6b62aff5aa60b8f170320cd7c3f32d7">gpresUser</a>) == FALSE);</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    InitializeObjectAttributes( &amp;Obja,</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                                NULL,</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                                0,</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                                NULL,</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;                                NULL</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                              );</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160; </div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    Status = PsCreateSystemThread(</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;                    phThread,</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                    THREAD_ALL_ACCESS,</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                    &amp;Obja,</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                    0L,</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                    NULL,</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                    lpThreadAddress,</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                    pvContext</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                    );</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;}</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160; </div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;NTSTATUS</div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="a00899.html#a976f9b155040dd2170478c6f3184561e">  139</a></span>&#160;<a class="code" href="a00680.html#a976f9b155040dd2170478c6f3184561e">InitSystemThread</a>(</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    PUNICODE_STRING pstrThreadName)</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;{</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    PW32PROCESS Win32Process;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    PW32THREAD Win32Thread;</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    PEPROCESS Process;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    CheckCritOut();</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    Thread = PsGetCurrentThread();</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    Process = Thread-&gt;ThreadsProcess;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160; </div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="comment">     * check to see if process is already set, if not, we</span></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="comment">     * need to set it up as well</span></div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">if</span> ( Process-&gt;Win32Process ) {</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        Win32Process = NULL;</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        }</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160; </div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="comment">         * The process is not set</span></div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(PsCreateWin32Process(Process))) {</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;            <span class="keywordflow">return</span> STATUS_NO_MEMORY;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;            }</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        Win32Process = (PW32PROCESS)Process-&gt;Win32Process;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        }</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="comment">     * The one case we want to enter the User critical section but we</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="comment">     * don&#39;t really have a PTI yet.</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <a class="code" href="a03257.html#a8cc8c8071c3b38eb6abd3dd172e4a79b">gptiCurrent</a> = NULL;</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="comment">     * We have the W32 process (or don&#39;t need one). Now get the thread data</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="comment">     * and the kernel stack</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    Win32Thread = UserAllocPoolWithQuota(<span class="keyword">sizeof</span>(<a class="code" href="a02889.html">THREADINFO</a>), <span class="stringliteral">&#39;rhtW&#39;</span>);</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">if</span> ( !Win32Thread ) {</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        <span class="keywordflow">if</span> ( Win32Process ) {</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;            Process-&gt;Win32Process = NULL;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;            UserFreePool(Win32Process);</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;            }</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="keywordflow">return</span> STATUS_NO_MEMORY;</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        }</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    RtlZeroMemory(Win32Thread, <span class="keyword">sizeof</span>(<a class="code" href="a02889.html">THREADINFO</a>));</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    Win32Thread-&gt;Thread = Thread;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160; </div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="comment">     * Everything is allocated, so set up the data</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordflow">if</span> ( Win32Process ) {</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        Process-&gt;Win32Process = Win32Process;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;        Status = <a class="code" href="a00680.html#acf9e2c7fe5f9c95e7c76d945174fb5ea">W32pProcessCallout</a>(Win32Process,TRUE);</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;        <span class="keywordflow">if</span> ( !NT_SUCCESS(Status) ) {</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;            <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;            }</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        }</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    Thread-&gt;Tcb.Win32Thread = Win32Thread;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <a class="code" href="a03257.html#a8cc8c8071c3b38eb6abd3dd172e4a79b">gptiCurrent</a> = (<a class="code" href="a00365.html#a177dce23f2b497ba8dc22f5a92d3f3d3">PTHREADINFO</a>)Win32Thread;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160; </div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="comment">     * Allocate a pti for this thread</span></div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    Status = <a class="code" href="a00824.html#abfd2ef0f8a995e8d2f10f8f0248faf5e">xxxCreateThreadInfo</a>(Win32Thread);</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;        UserFreePool(Win32Thread);</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;        Thread-&gt;Tcb.Win32Thread = NULL;</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    }</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160; </div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    pti = PtiCurrentShared();</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keywordflow">if</span> (pstrThreadName) {</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> != NULL)</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;            UserFreePool(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>);</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> = UserAllocPoolWithQuota(<span class="keyword">sizeof</span>(UNICODE_STRING) +</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;                pstrThreadName-&gt;MaximumLength, TAG_TEXT);</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> != NULL) {</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Buffer = (PWCHAR)(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> + 1);</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;            RtlCopyMemory(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Buffer, pstrThreadName-&gt;Buffer,</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;                    pstrThreadName-&gt;Length);</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;MaximumLength = pstrThreadName-&gt;MaximumLength;</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Length = pstrThreadName-&gt;Length;</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;        }</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    }</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="comment">     *  Need to clear the W32PF_APPSTARTING bit so that windows created by</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="comment">     *  the RIT don&#39;t cause the cursor to change to the app starting</span></div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;<span class="comment">     *  cursor.</span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>)</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags &amp;= ~W32PF_APPSTARTING;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160; </div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    ObReferenceObject(Thread);</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160; </div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="keywordflow">return</span> STATUS_SUCCESS;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;}</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;VOID</div>
<div class="line"><a name="l00253"></a><span class="lineno"><a class="line" href="a00680.html#a3fcbeedd003f73b5cd3f896883dd1b37">  253</a></span>&#160;<a class="code" href="a00680.html#a3fcbeedd003f73b5cd3f896883dd1b37">UserRtlRaiseStatus</a>(</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    NTSTATUS Status)</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;{</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    ExRaiseStatus(Status);</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;}</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160; </div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;NTSTATUS</div>
<div class="line"><a name="l00260"></a><span class="lineno"><a class="line" href="a00899.html#a77b4a808c8bc2285c46b6cf1b1415958">  260</a></span>&#160;<a class="code" href="a00680.html#a77b4a808c8bc2285c46b6cf1b1415958">CommitReadOnlyMemory</a>(</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    HANDLE hSection,</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    ULONG cbCommit,</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwCommitOffset)</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;{</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    ULONG ulViewSize;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    LARGE_INTEGER liOffset;</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    PEPROCESS Process;</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    PVOID pUserBase;</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160; </div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    ulViewSize = 0;</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    pUserBase = NULL;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    liOffset.QuadPart = 0;</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    Process = PsGetCurrentProcess();</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    Status = MmMapViewOfSection(hSection, Process,</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;            &amp;pUserBase, 0, <a class="code" href="a03665.html#a7d467c1d283fdfa1f2081ba1e0d01b6e">PAGE_SIZE</a>, &amp;liOffset, &amp;ulViewSize, ViewUnmap,</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;            SEC_NO_CHANGE, PAGE_EXECUTE_READ);</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160; </div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160; </div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;<span class="comment">         * Commit the memory</span></div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;        pUserBase = (PVOID)((PBYTE)pUserBase + dwCommitOffset);</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;        Status = ZwAllocateVirtualMemory(NtCurrentProcess(),</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;                                        &amp;pUserBase,</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;                                        0,</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;                                        &amp;cbCommit,</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;                                        MEM_COMMIT,</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                                        PAGE_EXECUTE_READ</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;                                        );</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;        MmUnmapViewOfSection(Process, pUserBase);</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    }</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;}</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160; </div>
<div class="line"><a name="l00297"></a><span class="lineno"><a class="line" href="a00680.html#ae16d8ff8c8b1262d8c8a3b9a97bc58e7">  297</a></span>&#160;<span class="preprocessor">#define ROUND_UP_TO_PAGES(SIZE) (((ULONG)(SIZE) + PAGE_SIZE - 1) &amp; \</span></div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;<span class="preprocessor">        ~(PAGE_SIZE - 1))</span></div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160; </div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;<span class="keyword">extern</span> HANDLE <a class="code" href="a00680.html#aa29eee5c4d269ff2d6fe0a66b9de9041">ghReadOnlySharedSection</a>;</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160; </div>
<div class="line"><a name="l00302"></a><span class="lineno"><a class="line" href="a00680.html#aa2d69d976a60e1a4b4a397bd0783ba5a">  302</a></span>&#160;<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> <a class="code" href="a00680.html#aa2d69d976a60e1a4b4a397bd0783ba5a">cbSharedAlloc</a> = 0;</div>
<div class="line"><a name="l00303"></a><span class="lineno"><a class="line" href="a00680.html#a7a9331d5aa7c36832e823f5aba0ce3b2">  303</a></span>&#160;<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> <a class="code" href="a00680.html#a7a9331d5aa7c36832e823f5aba0ce3b2">cbCommitted</a> = 0;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno"><a class="line" href="a00899.html#acc256802779139910c948a2c9ef7cb13">  305</a></span>&#160;PVOID <a class="code" href="a00680.html#a3d55823092d5efdce994868cd5efa7d8">SharedAlloc</a>(</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> <a class="code" href="a00719.html#a0d8ef5056a80a305334bd6c49dfbe32a">cbAlloc</a>)</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;{</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    PVOID pv = NULL;</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> cbLimit;</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwCommitOffset;</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160; </div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;<span class="comment">     * Round up allocation to next DWORD</span></div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;    <a class="code" href="a00719.html#a0d8ef5056a80a305334bd6c49dfbe32a">cbAlloc</a> = (<a class="code" href="a00719.html#a0d8ef5056a80a305334bd6c49dfbe32a">cbAlloc</a> + 3) &amp; ~3;</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160; </div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;<span class="comment">     * Commit the memory if needed.</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    cbLimit = <a class="code" href="a00680.html#aa2d69d976a60e1a4b4a397bd0783ba5a">cbSharedAlloc</a> + <a class="code" href="a00719.html#a0d8ef5056a80a305334bd6c49dfbe32a">cbAlloc</a>;</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00680.html#a7a9331d5aa7c36832e823f5aba0ce3b2">cbCommitted</a> &lt; cbLimit) {</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160; </div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="comment">         * Map the section into the current process and commit the</span></div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;<span class="comment">         * desired pages of the section.</span></div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        cbLimit = <a class="code" href="a00680.html#ae16d8ff8c8b1262d8c8a3b9a97bc58e7">ROUND_UP_TO_PAGES</a>(cbLimit);</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;        dwCommitOffset = (ULONG)((PBYTE)<a class="code" href="a03257.html#a0d0e16dfc8a9c0805c94a8c26d21a163">ghheapSharedRO</a> -</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;                (PBYTE)<a class="code" href="a03257.html#a333e3ab0aeefbd49df4da9480fff5eb9">gpReadOnlySharedSectionBase</a> + <a class="code" href="a00680.html#a7a9331d5aa7c36832e823f5aba0ce3b2">cbCommitted</a>);</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(<a class="code" href="a00680.html#a77b4a808c8bc2285c46b6cf1b1415958">CommitReadOnlyMemory</a>(<a class="code" href="a00680.html#aa29eee5c4d269ff2d6fe0a66b9de9041">ghReadOnlySharedSection</a>,</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;                cbLimit, dwCommitOffset)))</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;        <a class="code" href="a00680.html#a7a9331d5aa7c36832e823f5aba0ce3b2">cbCommitted</a> = cbLimit;</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    }</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160; </div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    pv = (PBYTE)<a class="code" href="a03257.html#a0d0e16dfc8a9c0805c94a8c26d21a163">ghheapSharedRO</a> + <a class="code" href="a00680.html#aa2d69d976a60e1a4b4a397bd0783ba5a">cbSharedAlloc</a>;</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160; </div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    <a class="code" href="a00680.html#aa2d69d976a60e1a4b4a397bd0783ba5a">cbSharedAlloc</a> += <a class="code" href="a00719.html#a0d8ef5056a80a305334bd6c49dfbe32a">cbAlloc</a>;</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160; </div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    <span class="keywordflow">return</span> pv;</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;}</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160; </div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160; </div>
<div class="line"><a name="l00352"></a><span class="lineno"><a class="line" href="a00680.html#ab88ee77a5ba2ab882a962738aad51de8">  352</a></span>&#160;NTSTATUS <a class="code" href="a00680.html#ab88ee77a5ba2ab882a962738aad51de8">CreateDataSection</a>(</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;    IN <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> cbData,</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    OUT PHANDLE phSection,</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;    OUT PVOID *ppData)</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;{</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    LARGE_INTEGER liSize;</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;    ULONG ulViewSize;</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160; </div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;<span class="comment">     * Create the section</span></div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    liSize.LowPart = cbData;</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;    liSize.HighPart = 0;</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;    Status = MmCreateSection(</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;            phSection,</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;            SECTION_ALL_ACCESS,</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;            NULL,</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;            &amp;liSize,</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;            PAGE_READWRITE,</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;            SEC_COMMIT,</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;            NULL,</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;            NULL);</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;        <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160; </div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;<span class="comment">     * Map it into the process</span></div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    Status = MmMapViewOfSection(</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;            *phSection,</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;            PsGetCurrentProcess(),</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;            ppData,</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;            0,</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;            cbData,</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;            NULL,</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;            &amp;ulViewSize,</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;            ViewUnmap,</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;            0,</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;            PAGE_READWRITE);</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;        ObDereferenceObject(*phSection);</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160; </div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;}</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160; </div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160; </div>
<div class="line"><a name="l00408"></a><span class="lineno"><a class="line" href="a00899.html#abcdcb04a30d72772974e9df4b6f3c442">  408</a></span>&#160;PKEVENT <a class="code" href="a00680.html#abcdcb04a30d72772974e9df4b6f3c442">CreateKernelEvent</a>(</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;    IN EVENT_TYPE Type,</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;    IN BOOLEAN State)</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;{</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;    PKEVENT pEvent;</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160; </div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;    pEvent = ExAllocatePoolWithTag(NonPagedPool, <span class="keyword">sizeof</span>(KEVENT), TAG_SYSTEM);</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    <span class="keywordflow">if</span> (pEvent == NULL) {</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    }</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    KeInitializeEvent(pEvent, Type, State);</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    <span class="keywordflow">return</span> pEvent;</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;}</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160; </div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160; </div>
<div class="line"><a name="l00431"></a><span class="lineno"><a class="line" href="a00899.html#a4832274fb06553cc3f18721f32b8adaa">  431</a></span>&#160;VOID <a class="code" href="a00680.html#a272ad051235972d116b52e3a3e45af5d">LockObjectAssignment</a>(</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;    PVOID *pplock,</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;    PVOID pobject)</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;{</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;    PVOID pobjectOld;</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160; </div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;<span class="comment">     * Save old object to dereference AFTER the new object is</span></div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;<span class="comment">     * referenced.  This will avoid problems with relocking</span></div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;<span class="comment">     * the same object.</span></div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    pobjectOld = *pplock;</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160; </div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;<span class="comment">     * Reference the new object.</span></div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;    <span class="keywordflow">if</span> (pobject != NULL) {</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;        ObReferenceObject(pobject);</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;        *pplock = pobject;</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;        *pplock = NULL;</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;    }</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160; </div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;<span class="comment">     * Dereference the old object</span></div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    <span class="keywordflow">if</span> (pobjectOld != NULL) {</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;        ObDereferenceObject(pobjectOld);</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;    }</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;}</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160; </div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160; </div>
<div class="line"><a name="l00471"></a><span class="lineno"><a class="line" href="a00899.html#a9c35302383f335632b45ecea0a608ff4">  471</a></span>&#160;VOID <a class="code" href="a00680.html#a34eb15f38ea08383c244530c4d8bfab0">UnlockObjectAssignment</a>(</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;    PVOID *pplock)</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;{</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;    <span class="keywordflow">if</span> (*pplock != NULL) {</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;        ObDereferenceObject(*pplock);</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;        *pplock = NULL;</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;    }</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;}</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160; </div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160; </div>
<div class="line"><a name="l00489"></a><span class="lineno"><a class="line" href="a00899.html#aabde1aef2c62be654f3def31616f909a">  489</a></span>&#160;VOID <a class="code" href="a00680.html#a4e651db6bc5a53270aaa9886e26de7c4">ThreadLockObject</a>(</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;    PVOID pobj,</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;    <a class="code" href="a01881.html">PTL</a> ptl)</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160; </div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;{</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;    PVOID pfnT;</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160; </div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;<span class="comment">     * Store the address of the object in the thread lock structure and</span></div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;<span class="comment">     * link the structure into the thread lock list.</span></div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;<span class="comment">     * N.B. The lock structure is always linked into the thread lock list</span></div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;<span class="comment">     *      regardless of whether the object address is NULL. The reason</span></div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;<span class="comment">     *      this is done is so the lock address does not need to be passed</span></div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;<span class="comment">     *      to the unlock function since the first entry in the lock list</span></div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;<span class="comment">     *      is always the entry to be unlocked.</span></div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160; </div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!(PpiCurrent()-&gt;W32PF_Flags &amp; W32PF_TERMINATED));</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti);</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pobj == NULL || OBJECT_TO_OBJECT_HEADER(pobj)-&gt;PointerCount != 0);</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160; </div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160; </div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;<span class="comment">     * Get the callers address and validate the thread lock list.</span></div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;    ptl-&gt;<a class="code" href="a01881.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> = pti;</div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;    RtlGetCallersAddress(&amp;ptl-&gt;<a class="code" href="a01881.html#ac699f273cf44ff7606ee40b67e4c3b06">pfn</a>, &amp;pfnT);</div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;    <a class="code" href="a00680.html#a39bfe79224ebaeb29c95e90995169aa8">ValidateThreadLocks</a>(ptl, pti-&gt;<a class="code" href="a02889.html#a3febffea134a6a6f934300999c74af9d">ptlOb</a>);</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160; </div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160; </div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160; </div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;    ptl-&gt;<a class="code" href="a01881.html#acc0542aab965de5922a213f342d68542">next</a> = pti-&gt;<a class="code" href="a02889.html#a3febffea134a6a6f934300999c74af9d">ptlOb</a>;</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a3febffea134a6a6f934300999c74af9d">ptlOb</a> = ptl;</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;    ptl-&gt;<a class="code" href="a01881.html#aee4a3f12946e9853cfa2bca66597d59d">pobj</a> = pobj;</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;    <span class="keywordflow">if</span> (pobj != NULL) {</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;        ObReferenceObject(pobj);</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;    }</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160; </div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;}</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160; </div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160; </div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160; </div>
<div class="line"><a name="l00547"></a><span class="lineno"><a class="line" href="a00899.html#ac3937265237b1a08458023be81e0231d">  547</a></span>&#160;VOID <a class="code" href="a00680.html#a66df221fdc6a2befeaf8552ff54ab590">ThreadUnlockObject</a>(</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;{</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;    <a class="code" href="a01881.html">PTL</a> ptl;</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160; </div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;<span class="comment">     * Remove the thread lock structure from the thread lock list.</span></div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160; </div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;    ptl = pti-&gt;<a class="code" href="a02889.html#a3febffea134a6a6f934300999c74af9d">ptlOb</a>;</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a3febffea134a6a6f934300999c74af9d">ptlOb</a> = ptl-&gt;<a class="code" href="a01881.html#acc0542aab965de5922a213f342d68542">next</a>;</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160; </div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160; </div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;     <span class="comment">/*</span></div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;<span class="comment">      * Validate the thread lock list.</span></div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;<span class="comment">      */</span></div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160; </div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;     <a class="code" href="a00680.html#a39bfe79224ebaeb29c95e90995169aa8">ValidateThreadLocks</a>(ptl, pti-&gt;<a class="code" href="a02889.html#a3febffea134a6a6f934300999c74af9d">ptlOb</a>);</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160; </div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160; </div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;<span class="comment">     * If the object address is not NULL, then unlock the object.</span></div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160; </div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;    <span class="keywordflow">if</span> (ptl-&gt;<a class="code" href="a01881.html#aee4a3f12946e9853cfa2bca66597d59d">pobj</a> != NULL) {</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160; </div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;<span class="comment">         * Unlock the object.</span></div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;        ObDereferenceObject(ptl-&gt;<a class="code" href="a01881.html#aee4a3f12946e9853cfa2bca66597d59d">pobj</a>);</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;    }</div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;}</div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160; </div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160; </div>
<div class="line"><a name="l00591"></a><span class="lineno"><a class="line" href="a00899.html#a481c734b3eea8139a042653549741891">  591</a></span>&#160;NTSTATUS <a class="code" href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a>(</div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;    IN HANDLE Handle,</div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;    IN BOOLEAN Protect)</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;{</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;    OBJECT_HANDLE_FLAG_INFORMATION HandleInfo;</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160; </div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;    Status = ZwQueryObject(</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;            Handle,</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;            ObjectHandleFlagInformation,</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;            &amp;HandleInfo,</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;            <span class="keyword">sizeof</span>(HandleInfo),</div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;            NULL);</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;        <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160; </div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;    HandleInfo.ProtectFromClose = Protect;</div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160; </div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;    Status = ZwSetInformationObject(</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;            Handle,</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;            ObjectHandleFlagInformation,</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;            &amp;HandleInfo,</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;            <span class="keyword">sizeof</span>(HandleInfo));</div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aa00680_html_a77b4a808c8bc2285c46b6cf1b1415958"><div class="ttname"><a href="a00680.html#a77b4a808c8bc2285c46b6cf1b1415958">CommitReadOnlyMemory</a></div><div class="ttdeci">NTSTATUS CommitReadOnlyMemory(HANDLE hSection, ULONG cbCommit, DWORD dwCommitOffset)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00260">ex.c:260</a></div></div>
<div class="ttc" id="aa00680_html_aa2d69d976a60e1a4b4a397bd0783ba5a"><div class="ttname"><a href="a00680.html#aa2d69d976a60e1a4b4a397bd0783ba5a">cbSharedAlloc</a></div><div class="ttdeci">UINT cbSharedAlloc</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00302">ex.c:302</a></div></div>
<div class="ttc" id="aa03257_html_a333e3ab0aeefbd49df4da9480fff5eb9"><div class="ttname"><a href="a03257.html#a333e3ab0aeefbd49df4da9480fff5eb9">gpReadOnlySharedSectionBase</a></div><div class="ttdeci">PVOID gpReadOnlySharedSectionBase</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00053">kernel/globals.c:53</a></div></div>
<div class="ttc" id="aa00899_html_ae451a2dc8791c420d7c956a63adc33ba"><div class="ttname"><a href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a></div><div class="ttdeci">VOID EnterCrit(VOID)</div></div>
<div class="ttc" id="aa00680_html_a272ad051235972d116b52e3a3e45af5d"><div class="ttname"><a href="a00680.html#a272ad051235972d116b52e3a3e45af5d">LockObjectAssignment</a></div><div class="ttdeci">VOID LockObjectAssignment(PVOID *pplock, PVOID pobject)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00431">ex.c:431</a></div></div>
<div class="ttc" id="aa01881_html_a774eeae0f007ae3ea612baf38cd38936"><div class="ttname"><a href="a01881.html#a774eeae0f007ae3ea612baf38cd38936">_TL::pti</a></div><div class="ttdeci">PTHREADINFO pti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01536">userk.h:1536</a></div></div>
<div class="ttc" id="aa02889_html_a89857e53108d9b82242fbfb9b7b57dd5"><div class="ttname"><a href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">tagTHREADINFO::pstrAppName</a></div><div class="ttdeci">PUNICODE_STRING pstrAppName</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02296">userk.h:2296</a></div></div>
<div class="ttc" id="aa00680_html_a3fcbeedd003f73b5cd3f896883dd1b37"><div class="ttname"><a href="a00680.html#a3fcbeedd003f73b5cd3f896883dd1b37">UserRtlRaiseStatus</a></div><div class="ttdeci">VOID UserRtlRaiseStatus(NTSTATUS Status)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00253">ex.c:253</a></div></div>
<div class="ttc" id="aa00371_html_a162a73e20dfabca084a3ebb4581631a8"><div class="ttname"><a href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a></div><div class="ttdeci">#define UserAssert(exp)</div><div class="ttdef"><b>Definition:</b> <a href="a00950_source.html#l00117">usersrv.h:117</a></div></div>
<div class="ttc" id="aa00371_html_afa5f32de88404289ec03cd2c0e61e94f"><div class="ttname"><a href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a></div><div class="ttdeci">#define RIP_ERROR</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00028">winerrp.h:28</a></div></div>
<div class="ttc" id="aa03629_html"><div class="ttname"><a href="a03629.html">precomp.h</a></div></div>
<div class="ttc" id="aa00371_html_a31aafffb49dfe98bdc749c9b35c90162"><div class="ttname"><a href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a></div><div class="ttdeci">#define RIPMSG1(flags, szFmt, p1)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00132">winerrp.h:132</a></div></div>
<div class="ttc" id="aa00680_html_ab88ee77a5ba2ab882a962738aad51de8"><div class="ttname"><a href="a00680.html#ab88ee77a5ba2ab882a962738aad51de8">CreateDataSection</a></div><div class="ttdeci">NTSTATUS CreateDataSection(IN DWORD cbData, OUT PHANDLE phSection, OUT PVOID *ppData)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00352">ex.c:352</a></div></div>
<div class="ttc" id="aa00824_html_abfd2ef0f8a995e8d2f10f8f0248faf5e"><div class="ttname"><a href="a00824.html#abfd2ef0f8a995e8d2f10f8f0248faf5e">xxxCreateThreadInfo</a></div><div class="ttdeci">NTSTATUS xxxCreateThreadInfo(PW32THREAD W32Thread)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00933">queue.c:933</a></div></div>
<div class="ttc" id="aa02889_html_a215417492fadc11678c689da2447f02e"><div class="ttname"><a href="a02889.html#a215417492fadc11678c689da2447f02e">tagTHREADINFO::ppi</a></div><div class="ttdeci">struct tagPROCESSINFO * ppi</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02271">userk.h:2271</a></div></div>
<div class="ttc" id="aa00680_html_acf9e2c7fe5f9c95e7c76d945174fb5ea"><div class="ttname"><a href="a00680.html#acf9e2c7fe5f9c95e7c76d945174fb5ea">W32pProcessCallout</a></div><div class="ttdeci">NTSTATUS W32pProcessCallout(IN PW32PROCESS Process, IN BOOLEAN Initialize)</div></div>
<div class="ttc" id="aa03257_html_a8cc8c8071c3b38eb6abd3dd172e4a79b"><div class="ttname"><a href="a03257.html#a8cc8c8071c3b38eb6abd3dd172e4a79b">gptiCurrent</a></div><div class="ttdeci">PTHREADINFO gptiCurrent</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00021">kernel/globals.c:21</a></div></div>
<div class="ttc" id="aa01881_html_aee4a3f12946e9853cfa2bca66597d59d"><div class="ttname"><a href="a01881.html#aee4a3f12946e9853cfa2bca66597d59d">_TL::pobj</a></div><div class="ttdeci">PVOID pobj</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01534">userk.h:1534</a></div></div>
<div class="ttc" id="aa00680_html_a3d55823092d5efdce994868cd5efa7d8"><div class="ttname"><a href="a00680.html#a3d55823092d5efdce994868cd5efa7d8">SharedAlloc</a></div><div class="ttdeci">PVOID SharedAlloc(UINT cbAlloc)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00305">ex.c:305</a></div></div>
<div class="ttc" id="aa00563_html_a074685e97e89d6aa2accdfcb82328699"><div class="ttname"><a href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a></div><div class="ttdeci">ddeml v[i&lt; inst &gt;][t&lt; type &gt;][hObj|pObj] Dump DDEML state information ddeml lists all ddeml instances for this process n ddeml t&lt; type &gt; lists all ddeml objects of the given type n n assumes link is first DWORD</div><div class="ttdef"><b>Definition:</b> <a href="a00563_source.html#l00175">exts.h:175</a></div></div>
<div class="ttc" id="aa00680_html_a481c734b3eea8139a042653549741891"><div class="ttname"><a href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a></div><div class="ttdeci">NTSTATUS ProtectHandle(IN HANDLE Handle, IN BOOLEAN Protect)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00591">ex.c:591</a></div></div>
<div class="ttc" id="aa00680_html_a66df221fdc6a2befeaf8552ff54ab590"><div class="ttname"><a href="a00680.html#a66df221fdc6a2befeaf8552ff54ab590">ThreadUnlockObject</a></div><div class="ttdeci">VOID ThreadUnlockObject(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00547">ex.c:547</a></div></div>
<div class="ttc" id="aa00680_html_a976f9b155040dd2170478c6f3184561e"><div class="ttname"><a href="a00680.html#a976f9b155040dd2170478c6f3184561e">InitSystemThread</a></div><div class="ttdeci">NTSTATUS InitSystemThread(PUNICODE_STRING pstrThreadName)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00139">ex.c:139</a></div></div>
<div class="ttc" id="aa01881_html"><div class="ttname"><a href="a01881.html">_TL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00257_source.html#l00347">usercli.h:347</a></div></div>
<div class="ttc" id="aa00680_html_a4e651db6bc5a53270aaa9886e26de7c4"><div class="ttname"><a href="a00680.html#a4e651db6bc5a53270aaa9886e26de7c4">ThreadLockObject</a></div><div class="ttdeci">VOID ThreadLockObject(PTHREADINFO pti, PVOID pobj, PTL ptl)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00489">ex.c:489</a></div></div>
<div class="ttc" id="aa03665_html_a7d467c1d283fdfa1f2081ba1e0d01b6e"><div class="ttname"><a href="a03665.html#a7d467c1d283fdfa1f2081ba1e0d01b6e">PAGE_SIZE</a></div><div class="ttdeci">#define PAGE_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="a03665_source.html#l01258">kernel/server.c:1258</a></div></div>
<div class="ttc" id="aa03257_html_a0d0e16dfc8a9c0805c94a8c26d21a163"><div class="ttname"><a href="a03257.html#a0d0e16dfc8a9c0805c94a8c26d21a163">ghheapSharedRO</a></div><div class="ttdeci">PVOID ghheapSharedRO</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00051">kernel/globals.c:51</a></div></div>
<div class="ttc" id="aa00365_html_a177dce23f2b497ba8dc22f5a92d3f3d3"><div class="ttname"><a href="a00365.html#a177dce23f2b497ba8dc22f5a92d3f3d3">PTHREADINFO</a></div><div class="ttdeci">struct tagTHREADINFO * PTHREADINFO</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00762">user.h:762</a></div></div>
<div class="ttc" id="aa00680_html_aa29eee5c4d269ff2d6fe0a66b9de9041"><div class="ttname"><a href="a00680.html#aa29eee5c4d269ff2d6fe0a66b9de9041">ghReadOnlySharedSection</a></div><div class="ttdeci">HANDLE ghReadOnlySharedSection</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00052">kernel/globals.c:52</a></div></div>
<div class="ttc" id="aa02889_html_a3febffea134a6a6f934300999c74af9d"><div class="ttname"><a href="a02889.html#a3febffea134a6a6f934300999c74af9d">tagTHREADINFO::ptlOb</a></div><div class="ttdeci">PTL ptlOb</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02267">userk.h:2267</a></div></div>
<div class="ttc" id="aa00680_html_a2dc9a37319c0687eaf57b62a7f1ada4e"><div class="ttname"><a href="a00680.html#a2dc9a37319c0687eaf57b62a7f1ada4e">CreateSystemThread</a></div><div class="ttdeci">NTSTATUS CreateSystemThread(PKSTART_ROUTINE lpThreadAddress, PVOID pvContext, PHANDLE phThread)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00107">ex.c:107</a></div></div>
<div class="ttc" id="aa01881_html_ac699f273cf44ff7606ee40b67e4c3b06"><div class="ttname"><a href="a01881.html#ac699f273cf44ff7606ee40b67e4c3b06">_TL::pfn</a></div><div class="ttdeci">PVOID pfn</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01537">userk.h:1537</a></div></div>
<div class="ttc" id="aa00680_html_a7a9331d5aa7c36832e823f5aba0ce3b2"><div class="ttname"><a href="a00680.html#a7a9331d5aa7c36832e823f5aba0ce3b2">cbCommitted</a></div><div class="ttdeci">UINT cbCommitted</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00303">ex.c:303</a></div></div>
<div class="ttc" id="aa03257_html_ac6b62aff5aa60b8f170320cd7c3f32d7"><div class="ttname"><a href="a03257.html#ac6b62aff5aa60b8f170320cd7c3f32d7">gpresUser</a></div><div class="ttdeci">PERESOURCE gpresUser</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00169">kernel/globals.c:169</a></div></div>
<div class="ttc" id="aa01881_html_acc0542aab965de5922a213f342d68542"><div class="ttname"><a href="a01881.html#acc0542aab965de5922a213f342d68542">_TL::next</a></div><div class="ttdeci">struct _TL * next</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01533">userk.h:1533</a></div></div>
<div class="ttc" id="aa00680_html_a80a4bdd9ccbc04bf79c9c3e18860adfd"><div class="ttname"><a href="a00680.html#a80a4bdd9ccbc04bf79c9c3e18860adfd">OpenEffectiveToken</a></div><div class="ttdeci">NTSTATUS OpenEffectiveToken(PHANDLE phToken)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00028">ex.c:28</a></div></div>
<div class="ttc" id="aa00719_html_a0d8ef5056a80a305334bd6c49dfbe32a"><div class="ttname"><a href="a00719.html#a0d8ef5056a80a305334bd6c49dfbe32a">cbAlloc</a></div><div class="ttdeci">#define cbAlloc</div></div>
<div class="ttc" id="aa00899_html_ac2181d07596893ed44d18aa267ce4d23"><div class="ttname"><a href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a></div><div class="ttdeci">VOID LeaveCrit(VOID)</div></div>
<div class="ttc" id="aa03608_html_afd1a0e78d1f88954d93e48ab3821781f"><div class="ttname"><a href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a></div><div class="ttdeci">typedef UINT(FAR WINAPI *MSGSOUNDPROC)()</div></div>
<div class="ttc" id="aa00953_html_a28301f76c53b643912da7c538f74e2c6"><div class="ttname"><a href="a00953.html#a28301f76c53b643912da7c538f74e2c6">ASSERT</a></div><div class="ttdeci">#define ASSERT(expr)</div><div class="ttdef"><b>Definition:</b> <a href="a00953_source.html#l00023">bench.c:23</a></div></div>
<div class="ttc" id="aa00365_html_abce9368ed5b93dc4c0e3e9cc7c99157b"><div class="ttname"><a href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a></div><div class="ttdeci">struct _ETHREAD * PETHREAD</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00060">user.h:60</a></div></div>
<div class="ttc" id="aa00680_html_abcdcb04a30d72772974e9df4b6f3c442"><div class="ttname"><a href="a00680.html#abcdcb04a30d72772974e9df4b6f3c442">CreateKernelEvent</a></div><div class="ttdeci">PKEVENT CreateKernelEvent(IN EVENT_TYPE Type, IN BOOLEAN State)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00408">ex.c:408</a></div></div>
<div class="ttc" id="aa02889_html"><div class="ttname"><a href="a02889.html">tagTHREADINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02260">userk.h:2260</a></div></div>
<div class="ttc" id="aa00680_html_a34eb15f38ea08383c244530c4d8bfab0"><div class="ttname"><a href="a00680.html#a34eb15f38ea08383c244530c4d8bfab0">UnlockObjectAssignment</a></div><div class="ttdeci">VOID UnlockObjectAssignment(PVOID *pplock)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00471">ex.c:471</a></div></div>
<div class="ttc" id="aa00680_html_a297222c1c05315b3b86e418aebd79748"><div class="ttname"><a href="a00680.html#a297222c1c05315b3b86e418aebd79748">GetProcessLuid</a></div><div class="ttdeci">NTSTATUS GetProcessLuid(PETHREAD Thread, PLUID LuidProcess)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00061">ex.c:61</a></div></div>
<div class="ttc" id="aa00680_html_a39bfe79224ebaeb29c95e90995169aa8"><div class="ttname"><a href="a00680.html#a39bfe79224ebaeb29c95e90995169aa8">ValidateThreadLocks</a></div><div class="ttdeci">void ValidateThreadLocks(PTL NewLock, PTL OldLock)</div></div>
<div class="ttc" id="aa00680_html_ae16d8ff8c8b1262d8c8a3b9a97bc58e7"><div class="ttname"><a href="a00680.html#ae16d8ff8c8b1262d8c8a3b9a97bc58e7">ROUND_UP_TO_PAGES</a></div><div class="ttdeci">#define ROUND_UP_TO_PAGES(SIZE)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00297">ex.c:297</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_cd70cb5eb491250157f2d55d3ff4b13e.html">backup</a></li><li class="navelem"><a class="el" href="dir_ba2b673b566ba104b956abdc6dec0552.html">org</a></li><li class="navelem"><a class="el" href="dir_5bb0003d7907b45051943541418399f5.html">ntuser</a></li><li class="navelem"><a class="el" href="dir_2a0a56546b70a0973705719e6a88eab3.html">kernel</a></li><li class="navelem"><a class="el" href="a00680.html">ex.c</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
